<%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2018/5/31
  Time: 14:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>理赔柱状图</title>
    <script src="/static/plugins/eCharts/echarts-all.js"></script>
</head>
<body>
<div id="main" style="height:580px ; width:750px"></div>
<script>
    var myChart = echarts.init(document.getElementById('main'));

    var option = {
        tooltip: {
            show: true
        },
        /*legend: 图例*/
        legend: {
            data: ['理赔总额'],
            x: 'left'
        },
        /*title: 标题*/
        title: {
            text: "理赔报表",
            subtext:'${groupBy}',
            x: 'center'
        },
        xAxis: [
            {
                type: 'category',
                data: ${groupBys}
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        /*工具箱*/
        toolbox: {
            x: 'right',
            show: true,
            feature: {
                /*辅助线开关*/
                mark: {show: true},
                /*数据视图*/
                dataView: {show: true, readOnly: false},
                /*图标类型切换*/
                magicType: {show: true, type: ['line', 'bar']},
                /*还原视图*/
                restore: {show: true},
                /*保存为图片*/
                saveAsImage: {show: true}
            }
        },
        /*series,多个数据系列,可以在数组中内配置多个系列*/
        series: [
            {
                name: "销售总额",
                type: "bar",
                data: ${totalAmounts},
                markPoint: {
                    data: [
                        {type: 'max', name: '最大值'},
                        {type: 'min', name: '最小值'}
                    ]
                },
                markLine: {
                    data: [
                        {type: 'average', name: '平均值'}
                    ]
                }
            }
        ]


    };

    // 为echarts对象加载数据
    myChart.setOption(option);
</script>
</body>
</html>
